/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package servlet;

import dao.OrderDao;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


@WebServlet("/ocs")
public class OrderCheckServlet extends HttpServlet{

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        int orderId=Integer.parseInt(req.getParameter("orderid"));
        Boolean bool=new OrderDao().checkOrderForm(orderId);
        if(bool==false){
            resp.setContentType("text/html;charset=utf-8");
            resp.getWriter().println("<h1>确认收货失败！！</h1>");
            resp.getWriter().println("<a href='OrderInfo.jsp?orderid="+orderId+"'>返回订单信息页面</a>");
        }
        else{
            resp.sendRedirect("OrderInfo.jsp?orderid="+orderId);
        }
    }
    
}
